﻿<UserControl x:Class="PicturePortfolio.Silverlight.Views.AddEditCategoryView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ca="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"            
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" Height="300" Width="400">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Border Background="Black" Margin="5">
            <Grid>
                <StackPanel Orientation="Vertical">
                    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Background="Black" BorderThickness="1" BorderBrush="White">
                    <ListBox x:Name="ExistingCategories" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <ca:ActionMessage MethodName="CategorySelectionChanged">
                                    <ca:Parameter Value="{Binding ElementName=ExistingCategories,Path=SelectedItem}"></ca:Parameter>
                                </ca:ActionMessage>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Background="Black"></StackPanel> 
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Border BorderBrush="Gray" 
							                BorderThickness="1" 
							                CornerRadius="0" 
							                Background="Black" Margin="1" Width="370">
                                    <TextBlock x:Name="name" Text="{Binding CategoryName}" Foreground="White"></TextBlock>
                                </Border>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    </ScrollViewer>
                    <Button x:Name="DeleteCategory" Content="Delete" IsEnabled="{Binding EnableDisableDeleteButton}" Height="25" Width="70" HorizontalAlignment="Right"></Button>
                    <StackPanel Orientation="Horizontal" Height="25" Margin="0,10,0,0">
                        <TextBlock Text="New Category" Foreground="White"></TextBlock>
                        <TextBox x:Name="CategoryName" Width="220" Margin="10,0,0,0"></TextBox>
                        <Button x:Name="AddCategory" Content="Add" Width="70" Margin="10,0,0,0"></Button>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
